﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="LstProductOrder.ascx.cs" Inherits="Web.Cms.ProductCart.LstProductOrder" %>
<%@ Register TagPrefix="uc1" TagName="PagingAjax" Src="~/Cms/AjaxCP/Paging.ascx" %>
<script type="text/javascript">
    $(function () {
        $("#<%=tbx_DateFrom.ClientID %>").datepicker({ showOn: 'button', buttonImage: '/images/calendar_1.gif', buttonImageOnly: true });
        $("#<%=tbx_DateTo.ClientID %>").datepicker({ showOn: 'button', buttonImage: '/images/calendar_1.gif', buttonImageOnly: true });
    });
</script>
<div class="fl" style="padding-bottom: 20px;">
    <p class="heading" style="margin-left:400px; ">
        DANH SÁCH ĐƠN HÀNG</p>
</div>
<br />
<div style="clear:both;">
    <asp:Label ID="lblMessage" runat="server" Font-Bold="true" Font-Size="11px" 
        ForeColor="red"></asp:Label>
</div>
<table align="center" style="margin-left:250px" width="800px">
    <tr>
         <td class="style1">
            <strong>Mã khách hàng:</strong></td>
        <td>
            <asp:TextBox ID="txtCodeMember" runat="server" Height="20px" Text="0"></asp:TextBox>
        </td>
        <td class="style1">
            <strong>Từ ngày(yy/mm/dd):</strong></td>
        <td>
            <asp:TextBox ID="tbx_DateFrom" runat="server" Height="20px"></asp:TextBox>
        </td>
        <td class="style1">
            <strong>Đến ngày:</strong></td>
        <td>
            <asp:TextBox ID="tbx_DateTo" runat="server" Height="20px"></asp:TextBox>
        </td>
        <td>
            <asp:Button ID="btnTimKiem" runat="server" CssClass="Button_Search" 
                onclick="btnTimKiem_Click" />
        </td>
        <td>
            &nbsp;</td>
    </tr>
    </table>
<br />
<asp:GridView ID="grdProductOrder" runat="server" AutoGenerateColumns="False" 
    BackColor="White"  SkinID="AdminGridView" 
    EnableModelValidation="True"
    onrowcommand="grdProductOrder_RowCommand" 
    onrowdatabound="grdProductOrder_RowDataBound">
    <Columns>
        <asp:BoundField HeaderText="STT">
        <ItemStyle HorizontalAlign="Center" Width="20px" />
        <HeaderStyle HorizontalAlign="Center" />
        <ItemStyle />
        </asp:BoundField>
        <asp:BoundField DataField="CodeMember" HeaderText="Mã khách hàng" />
        <asp:BoundField DataField="FullName" HeaderText="Tên khách hàng" />
        <asp:BoundField DataField="OrderDate" HeaderText="Ngày đặt hàng" />
        <asp:TemplateField HeaderText="Tổng tiền">
            <ItemTemplate>
               <%# string.Format("{0:0,0}", Eval("TotalPrice"))%>
            </ItemTemplate>
        </asp:TemplateField>     
         <asp:TemplateField HeaderText="Tổng Dealxu">
            <ItemTemplate>
               <%# string.Format("{0:0,0}", Eval("TotalDealxu"))%>
            </ItemTemplate>
        </asp:TemplateField>                               
        <asp:TemplateField HeaderText="Trạng Thái">
            <ItemTemplate>
              <asp:Label runat="server" Text="" ID="lblStatus"></asp:Label>
            </ItemTemplate>
            
        </asp:TemplateField>
        <asp:TemplateField HeaderText="Action">
            <ItemTemplate>
                <asp:ImageButton ID="btnStatus" runat="server" 
                    CommandArgument='<%# Eval("OrderId") %>' CommandName="CommandStatus" />
            </ItemTemplate>
        </asp:TemplateField>
        <asp:TemplateField HeaderText="Chi tiết">
            <ItemTemplate>
                 <a style="cursor:hand;" href="javascript:void(0)" onclick="javascript:return showPopWinADMIN('../Cms/ProductCart/ProductOrderDetails.aspx?orderId=<%# Eval("OrderId") %>','Thông Tin Chi Tiết Đơn Hàng',1000,550,null,__doPostBack)"><img src="../App_Themes/Default/Images/Details.jpg" border="0"></a>
            </ItemTemplate>
        </asp:TemplateField>
        <asp:TemplateField HeaderStyle-Width="20" HeaderText="Xóa">
            <ItemTemplate>
                <asp:Button ID="btnDelete" runat="server" 
                    CommandArgument='<%# Eval("OrderId") %>' CommandName="Commanddelete" 
                    CssClass="Icon_Delete" 
                    OnClientClick="return confirm('Bạn có chắc chắn xóa đơn hàng này không ?')" />
            </ItemTemplate>
            <HeaderStyle Width="20px" />
        </asp:TemplateField>
    </Columns>
</asp:GridView>
<p style="text-align:center;">
    <br />            
    <asp:Label runat="server" ID="lbTotal" Font-Bold="true" Font-Size="15px" ForeColor="red"></asp:Label>            
    <br />  <br />
                
            <uc1:PagingAjax ID="PagingAjax1" runat="server" /> 
    <p>
    <br />
    <br />
</p>
